<!-- Main content -->
<section class="content">
    <div class="row">
        <!-- /.col -->
        <div class="col-md-12">
            <div class="box box-default">
                <div class="box-header with-border">
                    <h3 class="box-title">用户管理</h3>
                    <!-- /.box-tools -->
                    <div class="box-tools">
                        <form class="form-horizontal" action="{:url('/admin/user/index/index')}" method="post">
                            <div class="input-group input-group-sm" style="width: 250px;">
                                <input type="text" name="name" class="form-control pull-right" placeholder="用户名">

                                <div class="input-group-btn">
                                    <button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div style="margin-top: 10px;">
                    <div class="btn-group" style="margin-left: 10px;">
                        <a href="{:url('/admin/user/index/export')}" target="_blank" class="btn btn-danger ">
                            导出全部用户
                        </a>
                    </div>
                </div>
                <!-- /.box-header -->
                <div class="box-body table-responsive">
                    <table class="table table-bordered table-hover">
                        <tbody>
                            <tr>
                                <th class="hidden-xs">
                                    <label>
                                        <input onchange="checkAll()" type="checkbox" value="">
                                    </label>
                                </th>
                                <th>编号</th>
                                <th>用户名</th>
                                <th>账户</th>
                                <th>积分</th>
                                <th>等级</th>
                                <th>状态</th>
                                <th>备注</th>
                                <th>注册时间</th>
                                <th>操作</th>
                            </tr>
                            {volist name="userlist" id="user"}
                            <tr>
                                <td class="hidden-xs">
                                    <label>
                                        <input name="checkbox" class="check" type="checkbox" value="{$user.id}">
                                    </label>
                                </td>
                                <td>{$user.id}</td>
                                <td>
                                    {empty name="user.avater"}
                                        <img style="width: 50px;border-radius: 50%;" src="__PUBLIC__/static/dist/img/noimage.gif">
                                    {else /}
                                        <img style="width: 50px;border-radius: 50%;"
                                        src="__PUBLIC__/uploads/{$user['avater']['savepath']}{$user['avater']['savename']}">
                                    {/empty}
                                    <strong>{$user.username}</strong>                                        
                                </td>
                                <td>{$user.money}</td>
                                <td>{$user.score}</td>
                                <td>{$user.level}</td>
                                <td>
                                    {eq name="user.status" value="1"}
                                        <span class="label label-success">启用</span> 
                                    {else/}
                                        <span class="label label-default">禁用</span>
                                    {/eq}
                                </td>
                                <td>{$user.remark}</td>
                                <td>{$user.created_at}</td>
                                <td class="table-action">
                                    <a href="{:url('/admin/user/index/add',array('id'=>$user['id']))}">修改</a> 
                                    {gt name="user.id" value="1"} 
                                        {eq name="user.status" value="0"}
                                            <a href="{:url('/admin/user/index/update',array('id'=>$user['id'],'status'=>1))}">开启</a> 
                                        {else}
                                            <a href="{:url('/admin/user/index/update',array('id'=>$user['id'],'status'=>0))}">关闭</a> 
                                        {/eq}
                                        <!-- <a href="{:url('admin/user/index/del',array('id'=>$user['id']))}">删除</a>  -->
                                    {/gt}
                                </td>
                            </tr>
                            {/volist}
                        </tbody>
                    </table>
                </div>
                <div class="box-footer no-padding">
                    <div class="mailbox-controls">
                        <div class="btn-group">
                            <!-- <button type="button" class="btn btn-danger"
                                    onclick="batchUrl('{:url(\'admin/user/del\')}')">全部删除
                            </button> -->
                        </div>
                        <!-- /.btn-group -->
                        <div class="pull-right">
                            {$userlist->render()}
                        </div>
                        <!-- /.pull-right -->
                    </div>
                </div>
            </div>
            <!-- /. box -->
        </div>
        <!-- /.col -->
    </div>
</section>
